package com.gp.test.singleton;

/**
 * 单例模式demo
 *
 * @author
 * @create 2017-05-21 18:25
 */
public class Singleton {
	private static volatile Singleton singleton;

	private Singleton() {

	}

	public static Singleton getInstance() {
		if(singleton == null) {
			synchronized (Singleton.class) {
				if(singleton == null)
					singleton = new Singleton();
			}
		}
		return singleton;
	}
}
